//
//  JSMLeavingMoreTableViewCell.m
//  TakeYouTourTogether
//
//  Created by dllo on 15/12/2.
//  Copyright © 2015年 king. All rights reserved.
//

#import "JSMLeavingMoreTableViewCell.h"

@implementation JSMLeavingMoreTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.userImageView = [[BaseImageView alloc] init];
    [self.contentView addSubview:self.userImageView];
    
    self.userNameLabel = [[BaseLabel alloc] init];
    [self.contentView addSubview:self.userNameLabel];
    self.userNameLabel.textColor = [UIColor colorWithRed:1.000 green:0.462 blue:0.119 alpha:1.000];
    self.userNameLabel.font = [UIFont systemFontOfSize:15];
    
    self.titleLabel = [[BaseLabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    
    self.mainImageView = [[BaseImageView alloc] init];
    [self.contentView addSubview:self.mainImageView];
    self.mainImageView.layer.cornerRadius = 10;
    self.mainImageView.layer.masksToBounds = YES;
    
    self.backView = [[BaseView alloc] init];
    [self.contentView addSubview:self.backView];
}


- (void)layoutSubviews {
    [super layoutSubviews];
    self.backView.frame = CGRectMake(10, 5, TableViewCellWidth - 20, TableViewCellHeight - 10);
    self.userImageView.frame = CGRectMake(15, 10, (TableViewCellWidth - 30) / 8, (TableViewCellWidth - 30) / 8);
    self.userImageView.layer.cornerRadius = self.userImageView.frame.size.height / 2;
//    self.userImageView.layer.masksToBounds = YES;
    self.userNameLabel.frame = CGRectMake(15 + self.userImageView.frame.size.width, 10, TableViewCellWidth - 30 - self.userImageView.frame.size.width - (TableViewCellHeight - 20), self.userImageView.frame.size.height);
    self.mainImageView.frame = CGRectMake(TableViewCellWidth - 15 - (TableViewCellHeight - 20), 10, TableViewCellHeight - 20, TableViewCellHeight - 20);
    self.titleLabel.frame = CGRectMake(15, 10 + self.userImageView.frame.size.height, TableViewCellWidth - 30 - (TableViewCellHeight - 20), (TableViewCellHeight - 20 - self.userImageView.frame.size.height));
}

@end
